package cn.seaboot.admin;

import cn.seaboot.admin.starter.ApplicationPreparedListener;
import cn.seaboot.admin.starter.ApplicationStartedListener;
import cn.seaboot.admin.starter.ContextClosedListener;
import cn.seaboot.commons.core.SnowflakeFactory;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;

/**
 * Application starter
 *
 * @author Mr.css
 * @version 2019/12/10
 */
@EnableCaching
@MapperScan({"cn.seaboot.admin.**.dao"})
@SpringBootApplication
public class AdminApplication {

    public static void main(String[] args) {
        SnowflakeFactory.ofEnvironment(args);

        SpringApplication springApplication = new SpringApplication(AdminApplication.class);
        springApplication.addListeners(new ApplicationPreparedListener());
        springApplication.addListeners(new ApplicationStartedListener());
        springApplication.addListeners(new ContextClosedListener());
        springApplication.run(args);
    }

}

